import 'package:flutter_ble_ota/ota_callbck.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

import 'flutter_ble_ota_method_channel.dart';

abstract class FlutterBleOtaPlatform extends PlatformInterface {
  /// Constructs a FlutterBleOtaPlatform.
  FlutterBleOtaPlatform() : super(token: _token);

  static final Object _token = Object();

  static FlutterBleOtaPlatform _instance = MethodChannelFlutterBleOta();

  /// The default instance of [FlutterBleOtaPlatform] to use.
  ///
  /// Defaults to [MethodChannelFlutterBleOta].
  static FlutterBleOtaPlatform get instance => _instance;

  /// Platform-specific implementations should set this with their own
  /// platform-specific class that extends [FlutterBleOtaPlatform] when
  /// they register themselves.
  static set instance(FlutterBleOtaPlatform instance) {
    PlatformInterface.verifyToken(instance, _token);
    _instance = instance;
  }

  Future<String?> getPlatformVersion() {
    throw UnimplementedError('platformVersion() has not been implemented.');
  }

  Future<bool> startOTA(String filePath,{BleOtaCallback? callback}) {
    throw UnimplementedError('platformVersion() has not been implemented.');
  }

  Future<bool> connect(String address) {
    throw UnimplementedError('connect() has not been implemented.');
  }

  Future<bool> initOTA() {
    throw UnimplementedError('initOTA() has not been implemented.');
  }

  Future<bool> dispose() {
    throw UnimplementedError('dispose() has not been implemented.');
  }
}
